import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 宠物信息 */
export interface Pet {
          id: number; // 主键ID
          petName?: string; // 宠物名称
          ownerUserId?: number; // 宠物归属用户ID
          photoUrl: string; // 宠物照片地址
          avatarUrl: string; // 宠物头像地址
  }

// 宠物 API
export const PetApi = {
  // 查询宠物分页
  getPetPage: async (params: any) => {
    return await request.get({ url: `/javainfo/pet/page`, params })
  },

  // 查询宠物详情
  getPet: async (id: number) => {
    return await request.get({ url: `/javainfo/pet/get?id=` + id })
  },

  // 新增宠物
  createPet: async (data: Pet) => {
    return await request.post({ url: `/javainfo/pet/create`, data })
  },

  // 修改宠物
  updatePet: async (data: Pet) => {
    return await request.put({ url: `/javainfo/pet/update`, data })
  },

  // 删除宠物
  deletePet: async (id: number) => {
    return await request.delete({ url: `/javainfo/pet/delete?id=` + id })
  },

  /** 批量删除宠物 */
  deletePetList: async (ids: number[]) => {
    return await request.delete({ url: `/javainfo/pet/delete-list?ids=${ids.join(',')}` })
  },

  // 导出宠物 Excel
  exportPet: async (params) => {
    return await request.download({ url: `/javainfo/pet/export-excel`, params })
  },
}